<template>
  <div>
    <ul>
      <li v-for="(item,index) in arr" :key="index">
        {{item}}
      </li>
    </ul>
    <button @click="reverseFn">翻转</button><br>
    <button @click="alterFn">修改</button>
  </div>
</template>

<script>
export default {
  data(){
    return {
      arr:['张三','李四','刘五']
    }
  },
  methods:{
    reverseFn(){
      this.arr.reverse();
    },
    alterFn(){
      this.$set(this.arr , 0 ,'王二')
    }

  }
}
</script>

<style>

</style>